<form method="post" action="<?php echo $this->url_edit . @$edit->{$this->{$this->model}->primaryKey}; ?>"  enctype="multipart/form-data" class="form-horizontal">
<div class="row">
<div class="col-12">
	<div class="widget-box">
		<div class="widget-title">
			<span class="icon">
				<i class="glyphicon glyphicon-align-justify"></i>									
			</span>
			<h5><?php echo ((@$edit->{$this->{$this->model}->primaryKey} > 0)?'Thông tin ':'Thêm mới ').@strtolower($this->resource->RES_NAME);?></h5>
		</div>
		<div class="widget-content nopadding">
				<?php echo $this->atheme->group_input2('edit[cron_name]', 'Tên', '', 'span6 ', @$edit->cron_name, 'text', ''); ?>
				
				<?php 
				$cron_val = json_decode(@$edit->cron_rules);
				$day = array();
				$week = array(
					'-1' =>'tất cả',
					'1' =>'Thứ 2',
					'2' =>'Thứ 3',
					'3' =>'Thứ 4',
					'4' =>'Thứ 5',
					'5' =>'Thứ 6',
					'6' =>'Thứ 7',
					'0' =>'Chủ nhật',
				);
				$week = array(
					'-1' =>'Tất cả',
					'Sunday' =>'Chủ nhật',
					'Monday'=>'Thứ 2',
					'Tuesday'=>'Thứ 3',
					'Wednesday'=>'Thứ 4',
					'Thursday'=>'Thứ 5',
					'Friday'=>'Thứ 6',
					'Saturday'=>'Thứ 7',
					);
				$hours = array();
				$minutes = array();
				$val_day = @array_values(@$cron_val->day);
				$val_week = @array_values(@$cron_val->week);
				$val_hours = @array_values(@$cron_val->hours);
				$val_minutes = @array_values(@$cron_val->minutes);
				for($i=0; $i<=31; $i++) $day[$i] = $i;
				$day[0] = 'Tất cả';
				echo $this->atheme->group_text2('Run on type of day:','Chọn chạy theo ngày hoặc theo tuần');
				
				echo $this->atheme->group_select2('edit[cron_rules][day][]','Day of the Month:','','', $day,@$val_day,' multiple'); 
				
				echo $this->atheme->group_select2('edit[cron_rules][week][]','Day of the Week:','','', $week,@$val_week,' multiple'); 
				
				//$hours["-1"] = 'Tất cả';
				for($i=0; $i<=23; $i++) $hours[$i] = $i;
				
				echo $this->atheme->group_select2('edit[cron_rules][hours][]','Run at hours:','','', $hours,@$val_hours,' multiple'); 
				
				//$minutes["-1"] = 'Tất cả';
				for($i=0; $i<=59; $i++) $minutes[$i] = $i;
				echo $this->atheme->group_select2('edit[cron_rules][minutes][]','Run at minutes:','','', $minutes,@$val_minutes,' multiple'); 
				
				?>
				<div class="form-actions">
					<button type="submit" class="btn btn-primary btn-small"><?php echo ((@$edit->{$this->{$this->model}->primaryKey} > 0)?'Save':'Add');?></button> or <a class="text-danger" href="<?php echo $this->url_index;?>">Cancel</a>
				</div>
			
		</div>
	</div>						
</div>
</div>

</form>